1. Field of the Invention
The present invention relates to the design of distributed file systems. More specifically, the present invention relates to a method and an apparatus for facilitating delayed block allocation in a distributed file system.
2. Related Art
Distributed file systems are typically based on a client-server model, wherein a client wishing to access a file sends a request to a server to perform a file system operation, such as reading from a file or writing to a file. A file system write operation typically involves a number of steps. The first step usually involves allocating space on disk for the file that is being written to. This ensures that space is available to accommodate data associated with the write operation. At the same time, data for the write operation is moved from the address space of the application into kernel space within the operating system of the client. Next, the system transfers the data from the kernel space of the client to the disk at the server.
The step of allocating space is often very slow because it typically involves communicating with the server to ask the server to allocate space. The server then determines if space is available for the write operation and if so typically allocates space by actually reserving disk blocks for the file being written to. Finally, the server sends an acknowledgement to the client indicating that the allocation was successful.
Note that the step of transferring data from the client to the disk at the server typically has very little impact on write performance because this operation is typically performed asynchronously. Hence, the client application can go on to do other tasks while the data is being transferred to the disk.
Attempts have been made to speed up the allocation step by pre-allocating disk blocks to the client to satisfy write operations. For example, see “Disk Space Guarantees as a Distributed Resource Management Problem: A Case Study”, by Murthy Devarakonda, Anada Rao Ladi, Andy Zlotek, and Ajay Mohindra, Proceedings of the IEEE Symposium on Parallel and Distributed Processing, October 1995, pp. 289-292. This paper describes a system that pre-allocates a small number of blocks for a file when the application first creates a file page. As the file grows, the client has to continually return to the server to allocate more disk blocks. While this system speeds up the allocation process, the system suffers from having to continually allocate more disk blocks from the server for the file.
What is needed is a method and an apparatus that facilitates delayed block allocation in a distributed file system without the problems described above.